<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>借款详情</title>
<link href="/dist/css/all_min.css" tppabs="http://www.115yz.com/xjkc/dist/css/all_min.css" rel="stylesheet">
</head>
<body>
<!--页头 start-->
<div id="header" class="kc-fixed kc-boxBody kc-commonHeight kc-commonbg">
    <div class="kc-rel">   
        <div class="float-left kc-cannel kc-pos">
             <div class="icon-bar" onclick="backUrl()"></div>
        </div>
        <a class="float-left kc-title textCenter">借款详情</a>
         <!-- <img src="/dist/img/msg.png" class="kc-msg"> -->
    </div>
</div>
<!--页头 end-->
<!--主体 start-->

<div id="bodyer" class="kc-padbody kc-boxBody record-body order-body">
    <div style="height: 10px"></div>
    <div class="main-content" style="position:relative;padding-left: 12px;">
        <form id="form">
            <input type="hidden" name="ID" value="<?php echo $data['ID']   ?>">
            <input type="hidden" name="zhanqifei" value="<?php echo $data['zhanqifei']   ?>">
            <input type="hidden" name="yuqulv" value="<?php echo $data['yuqulv']   ?>">
            <input type="hidden" name="nianhualilv" value="<?php echo $data['nianhualilv']   ?>">

        <div><span>用户姓名</span><span><input name="" value="<?php echo $data['TrueName'] ?>"   readonly></span></div>
        <div><span>借款金额</span><span><input name="SalePrice" value="<?php echo $data['SalePrice'] ?>元"  readonly ></span></div>
        <div><span>借款期限</span><span><input name="jiekuandays" value="<?php echo $data['jiekuandays'] ?>天" readonly  ></span></div>
        <div><span>服务费用</span><span><input name="GuanliCost" value="<?php echo $data['GuanliCost'] ?>元"  readonly ></span></div>
        <div><span>到账金额</span><span><input name="daozhang" value="<?php echo $data['daozhang'];?>元"   readonly></span></div>
        <div><span>到期时间</span><span><input name="YyFkTime" value="<?php echo $data['YyFkTime'];?>"   readonly></span></div>
        <div style="position: relative;padding-bottom: 24px;"><span>到期应还</span><span><input type="" name="daoqiyinghua" value="<?php echo $data['daoqiyinghua'] ?>元" readonly></span></div>
        </form>
    </div>
    <div class="main-content order" style="position:relative;padding-left: 12px;">
    <div><img src="/dist/img/point.png" class="circle" onclick="oval(this)"><span style="color: #9B9B9B; margin-top: -3px; position: relative;">我已阅读并同意<a style="text-decoration: underline;color: #DBA86D" href="#">《借款协议》</a></span></div>
    </div>
    <div>
        <img style="width: 100%;position: relative;margin-top: 20px" src="/dist/img/confirmapply.png" onclick="apply()" >
    </div>
</div>
<!--主体 end-->
<!--页脚 start-->
<!--页脚 end-->
<script src="/resourse/jquery/jquery-1.11.3.min.js" tppabs="http://www.115yz.com/xjkc/resourse/jquery/jquery-1.11.3.min.js"></script>
<script src="/dist/js/all_min.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>
<script src="/dist/js/july.js" tppabs="http://www.115yz.com/xjkc/dist/js/all_min.js"></script>

<script type="text/javascript">
    let hostname = 'http://'+location.host;
    function oval(img){
        if(img.src ==hostname+'/dist/img/Oval.png'){
            img.src ="/dist/img/OO.png";//变实 其他按钮变空
            let divs = $(img).parent().siblings('.paypay').find('img.oval') ;
            for(let i=0; i<divs.length;i++){
                divs[i].src="/dist/img/Oval.png";
            }
        }else{
            img.src ="/dist/img/Oval.png"    
        }
    }

    function apply(){
        let proto = $('.circle').attr('src')
        if(proto!=='/dist/img/OO.png'){
            openTip('请同意《借款协议》'); 
            return false;     
        }
        $.ajax({
            url:'/index.php/index/apply',
            type:'post',
            data:$('#form').serialize(),
            dataType:'json',
            success:function(data){
                let json = JSON.parse(data)
                if(json.status==1){
                    openTip(json.msg)
                    setTimeout("url('/index.php/index/index')",1000)
                }else{
                     openTip(json.msg)
                    return
                }                   
            }
        })
    }


</script>
</body>
</html>